package com.yjd.pub.system.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.system.model.LinkageModel;
import com.yjd.pub.system.dao.ILinkageDao;

/**
 * <b>description</b>：数据字典数据访问层 <br>
 * <b>time</b>：2014-11-08 14:31:38 <br>
 * <b>author</b>： ready likun_557@163.com
 */
@Component("linkageDao")
public class LinkageDaoImpl extends BaseDaoImpl implements ILinkageDao {

	private static final String SQLMAPNAMESPACE = LinkageModel.class.getName();
	private static final String PKNAME = "linkage_id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public List getMyPageModel(Map paramMap) {
		return  this.getSqlMap(false).queryForList(this.getStatement("getMyPageModel"), paramMap);
	}

	@Override
	public long getMyPageModelCount(Map paramMap) {
		return Long.parseLong(this.getSqlMap(false).queryForObject(this.getStatement("getMyPageModelCount"),paramMap).toString());
	}

	@Override
	public void deleteByUpdate(String ids, int parentid) {
		Map<String,Object> paramMap= new HashMap<String,Object>();
		paramMap.put("ids", ids);
		paramMap.put("parentid", parentid);
		this.getSqlMap(true).delete(this.getStatement("deleteByUpdate"), paramMap);
		
	}


}
